<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page  import="com.ambow.Entity.*" %>
<%@ page  import="com.ambow.dao.*" %>
<%@ page  import="com.ambow.dao.impl.*" %>
<%@ page  import="com.ambow.service.*" %>
<%@ page  import="com.ambow.service.impl.*" %>
<%@ page  import="com.ambow.utils.*" %>
<%@ page  import="com.ambow.servlet.*" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="Keywords" content="关键词1,关键词2，关键词3,关键词4,……" />
<meta name="Description" content="你网页的简述" />
<meta name="Robots" content="All" />
<meta name="Generator" content="Dreamweaver" />
<title>教材管理系统</title>
<link href="<%=path%>/static/css/css.css" rel="stylesheet" type="text/css" />
<script language="javascript">
  
  function check(){
	  if(document.getElementById("select").value=="0"){
		  alert("请选择供应商");
		  document.getElementById("select").focus();
		  return false;
		  
		}else if(document.getElementById("amount").value==""){
			 alert("请填写数量");
			  document.getElementById("amount").focus();
			  return false;
			}else if(document.getElementById("cellid").value=="0"){
				 alert("请选择架位");
				 return false;
				}else if(document.getElementById("checkbox").checked==false){
					 alert("请选择书籍");
				return false;
			}
		  
		  return true;
  }
	 
</script>
</head>

<body>
<h3 id="subTitle">入库管理--入库</h3>

  <form action="<%=path%>/StockReceiveServlet?status=queryIsbn" method="post">
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0" class="table">
  
    <tr>
        <td width="20%" align="right" class="title2" >(请输入)ISBN：</td>
        <td class="within2bg">&nbsp;
            <input name="isbn" type="text"  class="input2" id="isbn" name="isbn" value="<%=request.getAttribute("isbn") %>" readonly="true"/>
            <input name="Submit2" type="submit" class="input2" value="查询"/> 
		</td>
    </tr>
   </table> 
   </form>
 <form action="<%=path%>/StockReceiveServlet?status=add" method="post" onsubmit="return check()">
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0" class="table">
 
    <tr>
      <td width="20%" align="right" class="title2">(请选择)供应商：</td>
      <td class="within2bg">&nbsp; 
      <% 
        List<Supplier> supplierList=(List)request.getSession().getAttribute("supplierList");
     if(supplierList!=null&&supplierList.size()!=0){
     
      %>
         <select name="select" id="select">
         <%  for(Supplier supplier:supplierList){ %>
                 <option  value="<%=supplier.getId() %>" ><%=supplier.getName() %></option>
              <% }
           }%>       
                 <option selected="selected" value="0">请选择</option>
             </select>
      </td>
    </tr>
    
    <tr>
        <td width="20%" align="right" class="title2">(请输入)教材数量：</td>
        <td class="within2bg">&nbsp;     
        <input name="amount" id="amount" type="text" class="input2" />
	    <input  type="hidden" name="isbn" value="<%=request.getAttribute("isbn")%>"/>
		</td>
    </tr>
    
    <tr>
      <td width="20%" align="right" class="title2">(请输入)架位：</td>
        <td class="within2bg">&nbsp;  
        <% 
        List<Cell> cellList=(List)request.getSession().getAttribute("cellList");
     if(cellList!=null&&cellList.size()!=0){
     
      %>
         <select name="cellid" id="cellid">
         <%  for(Cell cell:cellList){ %>
                 <option  value="<%=cell.getId() %>" ><%=cell.getName() %></option>
              <% }
           }%>       
                 <option selected="selected" value="0">请选择</option>
             </select>   
        
		
		</td>
    </tr>
    <tr>
      <td width="20%" align="right" class="title2">备注：</td>
        <td class="within2bg">&nbsp;     
        <textarea name="remark" id="remark" type="text"  rows=2 cols=17></textarea>
		
		</td>
    </tr>
    <tr>
      <td width="20%" align="right" class="input2" > </td>
      <td class="within2bg">&nbsp;
         <input name="Submit2" type="submit" class="input2" value="入库" /> 
		<input name="Submit3" type="reset" class="input2" value="重置"/>
      </td>
    </tr>
    
</table>

<HR>

<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0" class="table">
    <tr>
        <th colspan="8" class="p4"><span class="title2">以下为您所得到教材的详细信息</span></th>
    </tr>
    <tr>
        <td width="15%" align="center" class="title2">ISBN</td>
        <td width="15%" align="center" class="title2">教材名</td>
        <td width="8%" align="center" class="title2">作者</td>
        <td width="15%" align="center" class="title2">出版社</td>
        <td width="10%" align="center" class="title2">出版日期</td>
        <td width="8%" align="center" class="title2">版次</td>
        <td width="5%" align="center" class="title2">单价</td>
        <td width="5%" align="center" class="title2">选择</td>
    </tr>
    <% 
			List<TextBook> list=(List)request.getAttribute("list");
			if(list!=null&&list.size()!=0){
			   for(TextBook textBook :list){
				
			%>
    		
			<tr class="within2bg">
				<td align="center"><%=textBook.getISBN()%></td>
				<td align="center"><%=textBook.getName() %></td>
				<td align="center"><%=textBook.getAuthor() %></td>
				<td align="center"><%=textBook.getPublish()%></td>
				<td align="center"><%=textBook.getPublishTime()%></td>
				<td align="center"><%=textBook.getRevision() %></td>
				<td align="center"><%=textBook.getPrice()%></td>
				<td class="within2bg">&nbsp; 
				<input type="checkbox" id="checkbox" name="checkbox" value="<%=textBook.getId() %>">
				</td>
			

			</tr>
          <%   
		
				
			   }	
				
			}else{%>
        	  <tr align="center" class="within2bg">
				<td colspan="7" class="no_note">没有符合条件的记录</td>
			</tr>
			<%
			}
			%>
   
   
   
</table>
 </form>

</body>
</html>